环境
- Ubuntu 18.04
- Python 3.8.2
错误
查看pip版本的时候,执行
pip -V
报错cannot import name 'sysconfig' from 'distutils'
解决
添加源(原有基础上)
1
sudo vim /etc/apt/sources.list
把下面的内容插入到sources.list中去
1
2
3
4deb http://cn.archive.ubuntu.com/ubuntu bionic main multiverse restricted universe
deb http://cn.archive.ubuntu.com/ubuntu bionic-updates main multiverse restricted universe
deb http://cn.archive.ubuntu.com/ubuntu bionic-security main multiverse restricted universe
deb http://cn.archive.ubuntu.com/ubuntu bionic-proposed main multiverse restricted universeupdate更新命令
1
sudo apt-get update
安装pip3
1
sudo apt-get install python3-pip
成功
再次查看pip版本,可以看到正常返回pip版本信息